Allow negative literals in conditions #223
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, excellent project you've got here! I can't thank you enough, it's proving exceptionally useful, but I've run into a small bug I thought I should try to fix: conditions with negative numeric literals show an error despite working in MSBuild.
I'm using the IndexOf property function to find a character in a string, and then store its index in a property. When the character in question can't be found said function returns -1, and I check for that in a PropertyGroup condition later on:
As of commit 8abab26 this extension puts an error squiggle under the hyphen, reporting that it expects a right parenthesis, but the comparison works as expected in MSBuild.
Please excuse me if I've overstepped my bounds, but the changes required turned out to be rather simple, as far as I can tell, so I felt a pull request was justified. I'm not hugely confident that my addition of test cases to TestParseNoError is the best way to test for this, but after all the goal is ultimately to get those examples to parse without error. The new test cases fail before my changes but succeed afterwards, and all other tests continue to pass as well.
By all means let me know if I need to change anything, and thank you again for all your hard work!